package com.lt73.mapstrutdemo.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: hanxiao
 * @Date: 2022/3/19 16:36
 */
@RestController
public class IndexController {

    /**
     * @return
     */
    @ApiOperation(value = "index接口")
    @GetMapping(value = "/")
    public String index() {
        return "This is room project";
    }

    /**
     * tags 类似于group，下面会有一系列的接口
     * httpMethod是指接口页面上显示的请求方法
     *
     * @param str
     * @return
     */
    @ApiOperation(value = "测试有参数接口", notes = "note", tags = "tags", httpMethod = "POST", protocols = "protocols")
    @PostMapping(value = "/get/str")
    public String getInfo(String str) {
        return "test param";
    }
}
